import request from '@/utils/request'

/**
 * @description 购物车页面请求接口
 * @returns
 */
export const reqCart = () => {
  return request.get('/api/cart/cartList')
}
/**
 * 改变单选框的状态，更改服务器的数据
 * @param {*} id
 * @param {*} status
 * @returns
 */
export const reqChecked = (id, status) => {
  return request.get(`/api/cart/checkCart/${id}/${status}`)
}
/**
 * 购物车商品全选
 * @param {*} isChecked
 * @param {*} skuIdList
 * @returns
 */
export const batchCheckCart = (isChecked, skuIdList) => {
  return request.post(`/api/cart/batchCheckCart/${isChecked}`, skuIdList)
}
/**
 * 删除单个
 * @param {*} id
 * @returns
 */
export const deleteCart = (id) => {
  return request.delete(`/api/cart/deleteCart/${id}`)
}
/**
 * 删除全部选中
 * @param {*} skuIdList
 * @returns
 */
export const batchDeleteCart = (skuIdList) => {
  return request.post('/api/cart/batchDeleteCart', skuIdList)
}
/**
 * @description 获取用户信息
 * @returns
 */
export const getUserInfo = () => {
  return request.get('/api/user/passport/auth/getUserInfo')
}
